<template>
  <div class="PersonnelManagement-box">
    <div class="PerMana-TitleBox">
      <div class="PerMana-icon"></div>
      <span class="PerMana-Title">人员管理</span>
    </div>
    <div class="Personneltop-box">
      <!-- 人员筛选 -->
      <div class="Personnelscreening-box">
        <div class="staffTitle">
          <div class="staffTitle-left"></div>
          <div class="staffTitle-right">人员筛选</div>
        </div>
        <div class="filter-Box">
          <div class="filTer1">
            <el-select
              v-model="yuangongActive"
              placeholder="请选择员工"
              size="medium"
              style="width: 240px"
            >
              <el-option
                v-for="item in yuangongList"
                :key="item.id"
                :label="item.name"
                :value="item.name"
              />
            </el-select>
          </div>
          <div class="filTer2">
            <!-- 日期选择器 -->
            <el-config-provider :locale="locale">
              <el-date-picker
                v-model="shijianList"
                type="daterange"
                unlink-panels
                range-separator="至"
                start-placeholder="开始时间"
                end-placeholder="结束时间"
                :shortcuts="shortcuts"
                :size="size"
              />
            </el-config-provider>
          </div>
        </div>
        <div class="staffBox">
          <div class="staffBoxleft">
            <div class="staffBoxleftImg">
              <el-image
                style="width: 100px; height: 100px"
                src="https://tse1-mm.cn.bing.net/th/id/OIP-C.hsnwZAr2R2xUr97ScoSjrgAAAA?rs=1&pid=ImgDetMain"
                fit="fill"
              />
            </div>
            <div class="staffBoxleftName">
              <div class="stafftop">员工A</div>
              <div class="staffbtn">
                <div class="staffbtn-left">所属部门:</div>
                <div class="staffbtn-right">流程追踪部</div>
              </div>
            </div>
          </div>
          <div class="staffBoxshuxian"></div>
          <div class="staffBoxright">
            <div class="staffBoxright-icon"></div>
            <div class="staffBoxright-center">本周累计完成工作</div>
            <div class="staffBoxright-btn">
              <div class="staffbtnleft">110.5</div>
              <div class="staffbtnright">小时</div>
            </div>
          </div>
        </div>
      </div>
      <!-- 工作情况统计 -->
      <div class="WorkStatistics-box">
        <div class="staffTitle">
          <div class="staffTitle-left"></div>
          <div class="staffTitle-right">工作情况统计</div>
        </div>
        <div class="WorkEcharts-box">
          <situationEcharts />
        </div>
      </div>
    </div>
    <!-- 项目工时列表  -->
    <div class="ProjectHourList-box">
      <div class="staffTitle">
        <div class="staffTitle-left"></div>
        <div class="staffTitle-right">项目工时列表</div>
      </div>
      <div class="query-box">
        <el-select
          clearable
          size="large"
          v-model="shaixuanItem"
          filterable
          placeholder="请下拉选择或输入你想要查询的项目名称"
          remote-show-suffix
          style="width: 240px"
          @change="onChange"
        >
          <el-option
            v-for="item in shaixuanList"
            :key="item.id"
            :label="item.name"
            :value="item.name"
          />
        </el-select>
        <div class="biaozhuBox">
          <div class="Annotation1">
            <div class="hezi1"></div>
            <div class="title">正在进行</div>
          </div>
          <div class="Annotation2">
            <div class="hezi2"></div>
            <div class="title">结束</div>
          </div>
        </div>
      </div>
      <!-- 表格组件 -->
      <div class="TableBiaogeBox">
        <el-table
          :data="tableData"
          style="width: 100%"
          :row-class-name="tableRowClassName"
        >
          <el-table-column label="序号" width="100">
            <template #default="scope">
              {{ scope.$index + 1 }}
            </template>
          </el-table-column>
          <el-table-column prop="bianhao" label="项目编号" width="250" />
          <el-table-column prop="name" label="项目名称" width="500" />
          <el-table-column prop="neirong" label="工作内容" width="550" />
          <el-table-column prop="shichang" label="工作时长" width="200" />
          <el-table-column label="更多">
            <template #default="scope">
              <div class="diandiandian" @click="addGengdup(scope.row)"></div>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <!-- 分页组件 -->
      <div class="paginationBox">
        <el-config-provider :locale="locale">
          <el-pagination
            v-model:current-page="currentPage4"
            v-model:page-size="pageSize4"
            :page-sizes="[100, 200, 300, 400]"
            :size="size"
            :disabled="disabled"
            :background="background"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          />
        </el-config-provider>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref, onMounted } from "vue"
import situationEcharts from "./components/situationEcharts.vue"
import zhCn from "element-plus/es/locale/lang/zh-cn"
const locale = ref(zhCn)
const yuangongActive = ref("")
const yuangongList = ref([
  {
    name: "张三",
    id: "1"
  },
  {
    name: "李四",
    id: "2"
  },
  {
    name: "王五",
    id: "3"
  },
  {
    name: "赵六",
    id: "4"
  }
])
const shijianList = ref("")
const shaixuanItem = ref("")
const shaixuanList = ref([
  {
    name: "张三",
    id: "1"
  },
  {
    name: "李四",
    id: "2"
  },
  {
    name: "王五",
    id: "3"
  },
  {
    name: "赵六",
    id: "4"
  }
])
const onChange = (e) => {
  console.log(e)
}
const tableData = ref([
  {
    name: "天航岸端",
    bianhao: "xxxxxx",
    neirong: "模型制作:开发",
    shichang: "5小时",
    zhuangtai: 1
  },
  {
    name: "思域",
    bianhao: "xxxxxx",
    neirong: "模型制作:开发",
    shichang: "5小时",
    zhuangtai: 1
  },
  {
    name: "cocos",
    bianhao: "xxxxxx",
    neirong: "模型制作:开发",
    shichang: "5小时",
    zhuangtai: 2
  },
  {
    name: "流程管理系统",
    bianhao: "xxxxxx",
    neirong: "模型制作:开发",
    shichang: "5小时",
    zhuangtai: 1
  }
])
const tableRowClassName = ({ row, rowIndex }) => {
  if (row.zhuangtai == 1) {
    return "warning-row"
  } else if (row.zhuangtai == 2) {
    return "success-row"
  }
}
const addGengdup = (e) => {
  console.log(e)
}
</script>
<style scoped lang="less">
/deep/.el-table .warning-row {
  // --el-table-tr-bg-color: var(--el-color-warning-light-9);
  background-color: rgba(200, 250, 231);
}
/deep/.el-table .success-row {
  background-color: rgba(252, 229, 227);
}
/deep/.el-table th {
  background-color: #f5f5f5 !important; /* 强制覆盖默认样式 */
}
// width: 1680px;
// height:1026px;
.PersonnelManagement-box {
  width: 100%;
  height: 100%;
  background-color: rgba(247, 249, 252);
  padding: 20px;
  box-sizing: border-box;
  .PerMana-TitleBox {
    width: 155px;
    display: flex;
    position: absolute;
    align-items: center;
    justify-content: space-between;
    .PerMana-icon {
      width: 30px;
      height: 16px;
      background-color: red;
      background: url("@/assets/renyuanguanli/guanliLogo.png") no-repeat center;
      background-size: 100% 100%;
    }
    .PerMana-Title {
      font-size: 28px;
      font-weight: 600;
    }
  }
  .Personneltop-box {
    margin-top: 4%;
    width: 100%;
    height: 30%;
    display: flex;
    justify-content: space-between;
    .Personnelscreening-box {
      width: 49%;
      height: 100%;
      border-radius: 4px;
      background-color: #fff;
      box-sizing: border-box;
      padding: 20px;
      .staffTitle {
        width: 80px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .staffTitle-left {
          width: 3px;
          height: 18px;
          opacity: 1;
          background: #ffb200;
        }
        .staffTitle-right {
          font-size: 18px;
          font-weight: 500;
        }
      }
      .filter-Box {
        margin-top: 10px;
        width: 90%;
        height: 40px;
        display: flex;
        align-items: center;
        // justify-content: space-between;
        /deep/.el-range-editor.el-input__wrapper {
          margin-left: 20px;
          width: 300px;
        }
      }
      .staffBox {
        margin-top: 15px;
        width: 100%;
        height: 160px;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        .staffBoxleft {
          width: 50%;
          height: 100%;
          box-sizing: border-box;
          position: relative;
          padding: 30px 0px 30px 30px;
          display: flex;
          .staffBoxleftImg {
            width: 100px;
            height: 100px;
            // background-color: red;
          }
          .staffBoxleftName {
            width: 300px;
            height: 100px;
            padding: 10px;
            box-sizing: border-box;
            .stafftop {
              font-size: 35px;
            }
            .staffbtn {
              margin-top: 10px;
              font-size: 18px;
              display: flex;
              .staffbtn-left {
                color: #8f8f8f;
              }
              .staffbtn-right {
                margin-left: 10px;
                color: black;
              }
            }
          }
        }
        .staffBoxshuxian {
          width: 1px;
          height: 136px;
          background: url("@/assets/renyuanguanli/shuxian.png") no-repeat center;
          background-size: 100% 100%;
        }
        .staffBoxright {
          width: 50%;
          height: 100%;
          box-sizing: border-box;
          padding: 30px 0px 30px 50px;
          .staffBoxright-icon {
            width: 40px;
            height: 40px;
            background: url("@/assets/renyuanguanli/lantu.png") no-repeat center;
            background-size: 100% 100%;
          }
          .staffBoxright-center {
            margin-top: 5px;
            color: #8f8f8f;
          }
          .staffBoxright-btn {
            margin-top: 5px;
            display: flex;
            color: #8f8f8f;
            .staffbtnleft {
              font-size: 26px;
              color: black;
            }
            .staffbtnright {
              margin-left: 5px;
              font-size: 14px;
              line-height: 43px;
            }
          }
        }
      }
    }
    .WorkStatistics-box {
      width: 49%;
      height: 100%;
      border-radius: 4px;
      background-color: #fff;
      box-sizing: border-box;
      padding: 20px;
      .staffTitle {
        width: 120px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .staffTitle-left {
          width: 3px;
          height: 18px;
          opacity: 1;
          background: #ffb200;
        }
        .staffTitle-right {
          font-size: 18px;
          font-weight: 500;
        }
      }
      .WorkEcharts-box {
        width: 100%;
        height: 90%;
        // background-color: red;
      }
    }
  }
  .ProjectHourList-box {
    margin-top: 2%;
    width: 100%;
    height: 60%;
    border-radius: 4px;
    background-color: #fff;
    box-sizing: border-box;
    padding: 20px;
    .staffTitle {
      width: 120px;
      height: 30px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      .staffTitle-left {
        width: 3px;
        height: 18px;
        opacity: 1;
        background: #ffb200;
      }
      .staffTitle-right {
        font-size: 18px;
        font-weight: 500;
      }
    }
    .query-box {
      margin-top: 10px;
      width: 100%;
      height: 8%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      /deep/.el-select__wrapper {
        width: 500px;
      }
      .biaozhuBox {
        width: 240px;
        height: 60%;
        display: flex;
        justify-content: space-evenly;
        align-items: center;
        .Annotation1 {
          // width: 120px;
          display: flex;
          align-items: center;
          .hezi1 {
            margin-right: 10px;
            width: 18px;
            height: 12px;
            background-color: rgba(144, 240, 203);
          }
        }
        .Annotation2 {
          // width: 120px;
          display: flex;
          align-items: center;
          .hezi2 {
            margin-right: 10px;
            width: 18px;
            height: 12px;
            background-color: rgba(255, 186, 178);
          }
        }
      }
    }
    .TableBiaogeBox {
      margin-top: 15px;
      width: 100%;
      height: 75%;
      .diandiandian {
        cursor: pointer;
        width: 25px;
        height: 5px;
        background: url("@/assets/renyuanguanli/diandiandain.png") no-repeat
          center;
        background-size: 100% 100%;
      }
    }
    .paginationBox {
      width: 100%;
      height: 10%;
      display: flex;
      align-items: center;
      justify-content: center;
      // background-color: red;
    }
  }
}
</style>
